home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / gdb-4.5 / dist / gdb / doc / Makefile.in < prev    next >
Encoding:
Makefile  |  1992-03-25  |  9.5 KB  |  301 lines

  1. ##Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  2.  
  3. # Makefile for GDB documentation.
  4. # This file is part of GDB.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. srcdir = .
  19.  
  20. prefix = /usr/local
  21.  
  22. exec_prefix = $(prefix)
  23. bindir = $(exec_prefix)/bin
  24. libdir = $(exec_prefix)/lib
  25.  
  26. datadir = $(prefix)/lib
  27. mandir = $(prefix)/man
  28. man1dir = $(mandir)/man1
  29. man2dir = $(mandir)/man2
  30. man3dir = $(mandir)/man3
  31. man4dir = $(mandir)/man4
  32. man5dir = $(mandir)/man5
  33. man6dir = $(mandir)/man6
  34. man7dir = $(mandir)/man7
  35. man8dir = $(mandir)/man8
  36. man9dir = $(mandir)/man9
  37. infodir = $(prefix)/info
  38. includedir = $(prefix)/include
  39. docdir = $(datadir)/doc
  40.  
  41. SHELL = /bin/sh
  42.  
  43. INSTALL = install -c
  44. INSTALL_PROGRAM = $(INSTALL)
  45. INSTALL_DATA = $(INSTALL)
  46.  
  47. AR = ar
  48. AR_FLAGS = qv
  49. BISON = bison
  50. RANLIB = ranlib
  51.  
  52. # main GDB source directory
  53. gdbdir = ..
  54.  
  55. # Documentation (gdb.dvi) needs either GNU m4 or SysV m4; 
  56. # Berkeley/Sun don't have quite enough. 
  57. #M4=/usr/5bin/m4
  58. M4=gm4
  59.  
  60. # where to find texinfo; GDB dist should include a recent one
  61. TEXIDIR=$(srcdir)/${gdbdir}/../texinfo/fsf
  62.  
  63. # where to find makeinfo, preferably one designed for texinfo-2
  64. MAKEINFO=makeinfo
  65.  
  66. # where to find texi2roff, ditto
  67. TEXI2ROFF=texi2roff
  68.  
  69. # Where is the source dir for the READLINE library?  Traditionally in .. or .
  70. # (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
  71. READLINE_DIR = $(srcdir)/${gdbdir}/../readline
  72.  
  73. # Main GDB manual's source files
  74. SFILES_DOCDIR = \
  75.     $(srcdir)/gdb.texinfo $(srcdir)/pretex.m4 $(srcdir)/none.m4 \
  76.     $(srcdir)/all.m4 gdbinv-m.m4 gdbinv-s.m4 gdbVN.m4
  77.  
  78. # Which version of GDB manual? default includes everything
  79. CONFIG=all
  80.  
  81. #### Host, target, and site specific Makefile fragments come in here.
  82. ###
  83.  
  84. all install:
  85.  
  86. info: gdb.info gdbint.info
  87. all-doc: gdb.info gdb.dvi refcard.dvi gdb-internals gdbint.dvi
  88. clean-info:
  89.     -rm -f *.info*
  90.  
  91. install-info: info
  92.     for i in *.info* ; do \
  93.         $(INSTALL_DATA) $$i $(infodir)/$$i ; \
  94.     done
  95.  
  96. STAGESTUFF = *.info* gdb-all.texi gdbVN.m4
  97.  
  98. # Copy the object files from a particular stage into a subdirectory.
  99. stage1: force
  100.     -mkdir stage1
  101.     -mv $(STAGESTUFF) stage1
  102.  
  103. stage2: force
  104.     -mkdir stage2
  105.     -mv $(STAGESTUFF) stage2
  106.  
  107. stage3: force
  108.     -mkdir stage3
  109.     -mv $(STAGESTUFF) stage3
  110.  
  111. against=stage2
  112.  
  113. comparison: force
  114.     for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
  115.  
  116. de-stage1: force
  117.     -(cd stage1 ; mv -f * ..)
  118.     -rmdir stage1
  119.  
  120. de-stage2: force
  121.     -(cd stage2 ; mv -f * ..)
  122.     -rmdir stage2
  123.  
  124. de-stage3: force
  125.     -(cd stage3 ; mv -f * ..)
  126.     -rmdir stage3
  127.  
  128. clean:
  129.     rm -f gdb.dvi rluser.texinfo inc-hist.texi gdb-all* gdb.info* gdbVN.m4
  130.     rm -f gdb-internals gdbint.?? gdbint.??? gdbint.info
  131.     rm -f refcard.ps refcard.dvi refcard.log *~
  132.  
  133. # GDB QUICK REFERENCE (TeX dvi file, CM fonts)
  134. refcard.dvi : $(srcdir)/refcard.tex
  135.     TEXINPUTS=$(srcdir):.:$$TEXINPUTS tex refcard.tex; rm -f refcard.log 
  136.     rm -f rcfonts.tex
  137.  
  138. # GDB QUICK REFERENCE (PostScript output, common PS fonts)
  139. refcard.ps : $(srcdir)/refcard.tex $(srcdir)/psrc.sed
  140.     sed -f $(srcdir)/psrc.sed refcard.tex >psref.tex
  141.     TEXINPUTS=$(srcdir):.:$$TEXINPUTS tex psref.tex
  142.     dvips -t landscape psref -o; mv psref.ps refcard.ps
  143.     rm -f psref.dvi psref.log
  144.  
  145. # GDB QUICK REFERENCE (PostScript output, common PS fonts w/long names)
  146. lrefcard.ps : $(srcdir)/refcard.tex $(srcdir)/lpsrc.sed
  147.     sed -f $(srcdir)/lpsrc.sed refcard.tex >psref.tex
  148.     TEXINPUTS=$(srcdir):.:$$TEXINPUTS tex psref.tex
  149.     dvips -t landscape psref -o; mv psref.ps lrefcard.ps
  150.     rm -f psref.dvi psref.log
  151.  
  152. #  "Readline" appendices.  Get them here so both TeX and texi2roff can find.
  153. rluser.texinfo: ${READLINE_DIR}/doc/rluser.texinfo
  154.     ln -s ${READLINE_DIR}/doc/rluser.texinfo . || \
  155.     ln ${READLINE_DIR}/doc/rluser.texinfo . || \
  156.     cp ${READLINE_DIR}/doc/rluser.texinfo .
  157.  
  158. inc-hist.texi: ${READLINE_DIR}/doc/inc-hist.texi
  159.     ln -s ${READLINE_DIR}/doc/inc-hist.texi . || \
  160.     ln ${READLINE_DIR}/doc/inc-hist.texi . || \
  161.     cp ${READLINE_DIR}/doc/inc-hist.texi .
  162.  
  163. # File to record current GDB version number (copied from main dir Makefile.in)
  164. gdbVN.m4 : $(srcdir)/${gdbdir}/Makefile.in
  165.     echo "_define__(<_GDB_VN__>,`sed <$(srcdir)/../Makefile.in -n 's/VERSION = //p'`)" > ./gdbVN.m4
  166.  
  167. # GDB MANUAL: texinfo source, created by preprocessing w/m4
  168. # If you want other configs in the makefile, add or modify instructions for 
  169. # building source here, then change CONFIG (that way you get info, dvi, 
  170. # roff targets automatically for your config).
  171. # Be sure to not create a bad gdb-all.texi if ${M4} is missing or aborts...
  172. # The nonsense with gdbVN.m4 is to get this to run with both Sun and GNU make.
  173. #   Note that we can *generate* gdbVN.m4, but since we distribute one in the
  174. #   source directory for the benefit of people who *don't* use this makefile,
  175. #   VPATH will often tell make not to bother building it, because the one
  176. #   in the srcdir is up to date.  (if not, then make should build one here).
  177.  
  178. gdb-all.texi: ${SFILES_DOCDIR}
  179.     if [ ! -f ./gdbVN.m4 ]; then \
  180.         ln -s $(srcdir)/gdbVN.m4 . || \
  181.         ln $(srcdir)/gdbVN.m4 . || \
  182.         cp $(srcdir)/gdbVN.m4 . ; else true; fi
  183.     rm -f foobus.texinfo
  184.     ${M4} $(srcdir)/pretex.m4 $(srcdir)/none.m4 $(srcdir)/all.m4 \
  185.         gdbVN.m4 $(srcdir)/gdb.texinfo  >foobus.texinfo
  186.     rm -f gdb-all.texi
  187.     mv foobus.texinfo ./gdb-all.texi
  188.  
  189. # GDB MANUAL: TeX dvi file
  190. gdb.dvi : gdb-${CONFIG}.texi rluser.texinfo inc-hist.texi
  191.     TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdb-${CONFIG}.texi
  192.     TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdb-${CONFIG}.texi
  193.     texindex gdb-${CONFIG}.??
  194.     TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdb-${CONFIG}.texi
  195.     mv gdb-${CONFIG}.dvi ./gdb.dvi
  196.     rm -f gdb-${CONFIG}.?? gdb-${CONFIG}.???
  197.  
  198. # GDB MANUAL: info file
  199. # We're using texinfo2, and older makeinfo's may not be able to
  200. # cope with all the markup.  In the meantime, we distribute the info
  201. # files 
  202. gdb.info: gdb-${CONFIG}.texi
  203.     $(MAKEINFO) -o ./gdb.info gdb-${CONFIG}.texi
  204.  
  205. # GDB MANUAL: roff translations
  206. # Try to use a recent texi2roff.  v2 was put on prep in jan91.
  207. # If you want an index, see texi2roff doc for postprocessing 
  208. # and add -i to texi2roff invocations below.
  209. # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
  210. #    corresponding -e lines when later texi2roff's are current)
  211. # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
  212. # + @c's deleted explicitly because texi2roff sees texinfo commands in them
  213. # + @   (that's at-BLANK) not recognized by texi2roff, turned into blank
  214. # + @alphaenumerate is ridiculously new, turned into @enumerate
  215.  
  216.  
  217. # gdb manual suitable for [tn]roff -mm
  218. # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, 
  219. #   try leaving them in
  220. # ditto special treatment of @ftable in rluser.texinfo
  221. gdb.mm: gdb-${CONFIG}.texi ${READLINE_DIR}/doc/rluser.texinfo inc-hist.texi
  222.     rm -f ./rluser.texinfo
  223.     sed -e 's/^@ftable/@table/g' \
  224.         -e 's/^@end ftable/@end table/g' \
  225.         ${READLINE_DIR}/doc/rluser.texinfo > ./rluser.texinfo
  226.     sed -e '/\\input texinfo/d' \
  227.         -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
  228.         -e '/^@ifinfo/,/^@end ifinfo/d' \
  229.         -e '/^@c/d' \
  230.         -e 's/{.*,,/{/' \
  231.         -e '/@noindent/d' \
  232.         -e 's/@ / /g' \
  233.         -e 's/^@alphaenumerate/@enumerate/g' \
  234.         -e 's/^@end alphaenumerate/@end enumerate/g' \
  235.         gdb-${CONFIG}.texi | \
  236.     $(TEXI2ROFF) -mm | \
  237.     sed -e 's/---/\\(em/g' \
  238.     >gdb.mm 
  239.     rm ./rluser.texinfo
  240.  
  241. # gdb manual suitable for [gtn]roff -me
  242. gdb.me: gdb-${CONFIG}.texi ${READLINE_DIR}/doc/rluser.texinfo inc-hist.texi
  243.     rm -f ./rluser.texinfo
  244.     sed -e 's/^@ftable/@table/g' \
  245.         -e 's/^@end ftable/@end table/g' \
  246.         ${READLINE_DIR}/doc/rluser.texinfo > ./rluser.texinfo
  247.     sed -e '/\\input texinfo/d' \
  248.         -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
  249.         -e '/^@ifinfo/,/^@end ifinfo/d' \
  250.         -e '/^@c/d' \
  251.         -e 's/{.*,,/{/' \
  252.         -e 's/@ / /g' \
  253.         -e 's/^@alphaenumerate/@enumerate/g' \
  254.         -e 's/^@end alphaenumerate/@end enumerate/g' \
  255.         gdb-${CONFIG}.texi | \
  256.     $(TEXI2ROFF) -me | \
  257.     sed -e 's/---/\\(em/g' \
  258.     >gdb.me 
  259.     rm ./rluser.texinfo
  260.  
  261. # gdb manual suitable for [gtn]roff -ms
  262. gdb.ms: gdb-${CONFIG}.texi ${READLINE_DIR}/doc/rluser.texinfo inc-hist.texi
  263.     rm -f ./rluser.texinfo
  264.     sed -e 's/^@ftable/@table/g' \
  265.         -e 's/^@end ftable/@end table/g' \
  266.         ${READLINE_DIR}/doc/rluser.texinfo > ./rluser.texinfo
  267.     sed -e '/\\input texinfo/d' \
  268.         -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
  269.         -e '/^@ifinfo/,/^@end ifinfo/d' \
  270.         -e '/^@c/d' \
  271.         -e 's/{.*,,/{/' \
  272.         -e 's/@ / /g' \
  273.         -e 's/^@alphaenumerate/@enumerate/g' \
  274.         -e 's/^@end alphaenumerate/@end enumerate/g' \
  275.         gdb-${CONFIG}.texi | \
  276.     $(TEXI2ROFF) -ms | \
  277.     sed -e 's/---/\\(em/g' \
  278.     >gdb.ms 
  279.     rm ./rluser.texinfo
  280.  
  281. # GDB INTERNALS MANUAL: TeX dvi file
  282. gdbint.dvi : gdbint.texinfo
  283.     TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdbint.texinfo
  284.     texindex gdbint.??
  285.     TEXINPUTS=${TEXIDIR}:.:$(srcdir):$$TEXINPUTS tex gdbint.texinfo
  286.     rm -f gdbint.?? gdbint.aux gdbint.cps gdbint.fns gdbint.kys \
  287.         gdbint.log gdbint.pgs gdbint.toc gdbint.tps gdbint.vrs
  288.  
  289. # GDB INTERNALS MANUAL: info file
  290. gdb-internals: gdbint.info
  291.  
  292. gdbint.info: gdbint.texinfo
  293.     $(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo
  294.  
  295. force:
  296.  
  297. Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
  298.     $(SHELL) ./config.status
  299.